package com.zc.controller.lhtController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;

/*
* 时间：2021.06.23
* 作者：李海涛
* */
@Controller
public class LhtController {
    @Autowired
    private LhtService lhtService;

    @RequestMapping("lhthello")
    @ResponseBody
    public String hello(@RequestParam("abc") String a){
        return a;
    }


    @RequestMapping("lhtquery")
    @ResponseBody
    public List<Student> lhtquery(){
        return lhtService.query();
    }
    @RequestMapping("lhtupdate")
    @ResponseBody
    public String  lhtupdate(Student student){
       // student.setAge(11);
        //student.setName("Liahtao");
       //student.setId(1);
        lhtService.lhtupdate(student);
        return "1";
    }
    @RequestMapping("lhtinsert")
    @ResponseBody
    public String  lhtinsert(Student student){
        //student.setAge(11);
        //student.setName("李海涛");
        lhtService.lhtinsert(student);
        return "1";
    }
    @RequestMapping("lhtdelete")
    @ResponseBody
    public String  lhtdelete(Student student){
       // student.setId(2);
        lhtService.lhtdelete(student);
        return "1";
    }

}
